import modules from '../modules'
import httpRequest from '../../utils/request'

const defaultRoute = 'BasicData_Roleinfo'

export interface RoleinfoParam {
  id: string;
  RoleNo: string;
  RoleName: string;
  Remark: string;
}



// 登录
export function apiGetBasicData_RoleinfoLogin(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Get${defaultRoute}Login`,
    method: "Post",
    data: param,
  });
}




// 获取角色列表
export function ApiGetBasicData_RoleinfoPageListAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Get${defaultRoute}PageList`,
    method: "Post",
    data: param,
  });
}



// 根据角色id获取菜单列表和已选菜单id
export function GetBasicData_Roleinfo_MenuInfoByIdTreeListAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Get${defaultRoute}_MenuInfoByIdTreeList`,
    method: "Post",
    data: param,
  });
}

// 批量删除角色
export function ApiBatchDeletionBasicData_RoleinfoAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/BatchDeletion${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


// 添加角色
export function ApiCreateBasicData_RoleinfoAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Create${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


// 修改角色
export function ApiUpdateBasicData_RoleinfoAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Update${defaultRoute}`,
    method: "Post",
    data: param,
  });
}

// 权限配置
export function ApiCreateBasicData_Roleinfo_MenuInfoAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Create${defaultRoute}_MenuInfo`,
    method: "Post",
    data: param,
  });
}


// 根据用户ID获取角色菜单列表
export function ApiGetBasicData_Roleinfo_MenuInfoListAsync(param: RoleinfoParam) {
  return httpRequest({
    url: `${modules.basicdataModuleUrl}/Roleinfo/Get${defaultRoute}_MenuInfoList`,
    method: "Post",
    data: param,
  });
}
